<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.2"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Hardware Abstraction Layer (HAL)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="logo.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Hardware Abstraction Layer (HAL)</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.2 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('group__group__hal__quaddec.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">API Reference</a> &#124;
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#enum-members">Enumerations</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle"><div class="title">Quadrature Decoder<div class="ingroups"><a class="el" href="group__group__hal.html">HAL Drivers</a></div></div></div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p >High level interface for interacting with the Quadrature Decoder hardware resource. </p>
<p >The quadrature decoder block is commonly used to measure the time of occurrence of an event, to measure the time difference between two events or perform an action after a specified period of time.</p>
<p >The Quadrature Decoder block provides the ability to count transitions on a pair of digital signals. The signals are typically provided by a speed/position feedback system mounted on a motor or trackball. The driver allows the user to invoke a callback function when a particular event occurs. The signals, typically called A and B, are positioned 90° out-of-phase, which results in a Gray code output (a sequence where only one bit changes on each count). It also allows detection of direction and relative position. A third optional signal, named index, is used as a reference to establish an absolute position once per rotation.</p>
<p >The Quadrature Decoder operates in one of three resolution modes. (see <a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a>) The mode dictates the number of events that are counted.</p>
<div class="image">
<img src="quadrature_mode.png" alt=""/>
</div>
<p >An index event causes the counter to be set to the midpoint. For example, if the hardware has 16-bit resolution, the midpoint would be 0x8000. For 32-bit resolution: 0x80000000.</p>
<div class="image">
<img src="quadrature_index.png" alt=""/>
</div>
<p >For more details about this functionality, see the "Quadrature Decoder Mode" section of the Technical Reference Manual.</p>
<p >Some use case scenarios of the Quadrature Decoder:</p>
<ul>
<li>Decode the output of a quadrature encoder (e.g., mouse, trackball, robotic axles, etc.).</li>
<li>Precision measurement of speed, acceleration, and position of a motor's rotor and with rotary knobs to determine user input.</li>
</ul>
<h1><a class="anchor" id="subsection_quaddec_features"></a>
Features</h1>
<ul>
<li>Configurable resolution - <a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a></li>
<li>Interrupt on various events - <a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a></li>
</ul>
<h1><a class="anchor" id="subsection_quaddec_quickstart"></a>
Quick Start</h1>
<p ><a class="el" href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">cyhal_quaddec_init</a> can be used for quadrature decoder initialization by providing the quaddec object - <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a>, input pins, and shared clock source - <b> clk </b> (optional).</p>
<p >See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_1">Snippet 1: Initialization and direction detection</a>.</p>
<h1><a class="anchor" id="subsection_quaddec_sample_snippets"></a>
Code Snippets</h1>
<h2><a class="anchor" id="subsection_quaddec_snippet_1"></a>
Snippet 1: Initialization and direction detection</h2>
<p >The following snippet initializes a quadrature decoder and measures the counter to determine direction. The <b>clk</b> may be left NULL, in which case a clock resource is automatically assigned. </p><div class="fragment"><div class="line">    <a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> quaddec_obj;</div>
<div class="line">    uint32_t        count = 0x8000, prev_count = 0x8000;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize the quadrature decoder object. Does not use index (&#39;pin&#39; is NC) and does not use a</span></div>
<div class="line">    <span class="comment">// pre-configured clock source (&#39;clk&#39; is NULL).</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">cyhal_quaddec_init</a>(&amp;quaddec_obj, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a>, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a>, <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17">CYHAL_QUADDEC_RESOLUTION_1X</a>, NULL,</div>
<div class="line">                              1000000);</div>
<div class="line">    CY_ASSERT(<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt);</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Start the quadrature decoder</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__quaddec.html#ga8fc53534a07e2977fc2a433d92caeb8f">cyhal_quaddec_start</a>(&amp;quaddec_obj);</div>
<div class="line">    CY_ASSERT(<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">while</span> (loop)</div>
<div class="line">    {</div>
<div class="line">        count = <a class="code hl_function" href="group__group__hal__quaddec.html#ga7b3adb4bcbbdf79d5cae28fdc3c028a3">cyhal_quaddec_read_counter</a>(&amp;quaddec_obj);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Check for direction of change</span></div>
<div class="line">        <span class="keywordflow">if</span> (count &gt; prev_count)</div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// Clockwise rotation</span></div>
<div class="line">        }</div>
<div class="line">        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (count &lt; prev_count)</div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// Counter Clockwise rotation</span></div>
<div class="line">        }</div>
<div class="line">        <span class="keywordflow">else</span></div>
<div class="line">        {</div>
<div class="line">            <span class="comment">// No change</span></div>
<div class="line">        }</div>
<div class="line"> </div>
<div class="line">        prev_count = count;</div>
<div class="line">    }</div>
<div class="ttc" id="agroup__group__hal__impl__hw__types_html_structcyhal__quaddec__t"><div class="ttname"><a href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a></div><div class="ttdoc">Quadrature Decoder object.</div><div class="ttdef"><b>Definition:</b> cyhal_hw_types.h:1105</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a></div><div class="ttdeci">@ P0_0</div><div class="ttdoc">Port 0 Pin 0.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:55</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a></div><div class="ttdeci">@ NC</div><div class="ttdoc">No Connect/Invalid Pin.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:53</div></div>
<div class="ttc" id="agroup__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble_html_gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73"><div class="ttname"><a href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a></div><div class="ttdeci">@ P0_1</div><div class="ttdoc">Port 0 Pin 1.</div><div class="ttdef"><b>Definition:</b> cyhal_psoc6_01_104_m_csp_ble.h:56</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ga7b3adb4bcbbdf79d5cae28fdc3c028a3"><div class="ttname"><a href="group__group__hal__quaddec.html#ga7b3adb4bcbbdf79d5cae28fdc3c028a3">cyhal_quaddec_read_counter</a></div><div class="ttdeci">uint32_t cyhal_quaddec_read_counter(const cyhal_quaddec_t *obj)</div><div class="ttdoc">Reads the current value from the quadrature decoder   The read operation works even if the counter is...</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ga8fc53534a07e2977fc2a433d92caeb8f"><div class="ttname"><a href="group__group__hal__quaddec.html#ga8fc53534a07e2977fc2a433d92caeb8f">cyhal_quaddec_start</a></div><div class="ttdeci">cy_rslt_t cyhal_quaddec_start(cyhal_quaddec_t *obj)</div><div class="ttdoc">Starts the quadrature decoder.</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_gab9ef0a9e37021273f9f013acb8a3ca33"><div class="ttname"><a href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">cyhal_quaddec_init</a></div><div class="ttdeci">cy_rslt_t cyhal_quaddec_init(cyhal_quaddec_t *obj, cyhal_gpio_t phi_a, cyhal_gpio_t phi_b, cyhal_gpio_t index, cyhal_quaddec_resolution_t resolution, const cyhal_clock_t *clk, uint32_t frequency)</div><div class="ttdoc">Initialize the quadrature decoder peripheral and configure the pin.</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17"><div class="ttname"><a href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17">CYHAL_QUADDEC_RESOLUTION_1X</a></div><div class="ttdeci">@ CYHAL_QUADDEC_RESOLUTION_1X</div><div class="ttdoc">1x resolution</div><div class="ttdef"><b>Definition:</b> cyhal_quaddec.h:133</div></div>
<div class="ttc" id="agroup__group__result_html_gaf58fac450d9fff4472f03ad68f6e546e"><div class="ttname"><a href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a></div><div class="ttdeci">#define CY_RSLT_SUCCESS</div><div class="ttdoc">cy_rslt_t return value indicating success</div><div class="ttdef"><b>Definition:</b> cy_result.h:465</div></div>
</div><!-- fragment --><h2><a class="anchor" id="subsection_quaddec_snippet_2"></a>
Snippet 2: Handling an event in a callback function</h2>
<p >The following snippet initializes a quadrature decoder and triggers an event as changes happen. The <b>clk</b> need not be provided (NULL), in which case a clock resource is assigned. </p><div class="fragment"><div class="line"><span class="keywordtype">bool</span> quaddec_interrupt_flag = <span class="keyword">false</span>;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// quadrature decoder object used</span></div>
<div class="line"><a class="code hl_struct" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> quaddec_obj;</div>
<div class="line"> </div>
<div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> quaddec_event_handler(<span class="keywordtype">void</span>* callback_arg, <a class="code hl_enumeration" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a> event)</div>
<div class="line">{</div>
<div class="line">    (void)callback_arg;</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> ((event &amp; <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88">CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</a>) == <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88">CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</a>)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// A terminal count event was triggered, insert code to handle event</span></div>
<div class="line">    }</div>
<div class="line">    <span class="keywordflow">if</span> ((event &amp; <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64">CYHAL_QUADDEC_IRQ_CAPTURE</a>) == <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64">CYHAL_QUADDEC_IRQ_CAPTURE</a>)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// A capture event was triggered, insert code to handle event</span></div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Set the interrupt flag and process it from the application</span></div>
<div class="line">    quaddec_interrupt_flag = <span class="keyword">true</span>;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> snippet_cyhal_quaddec_event_interrupt()</div>
<div class="line">{</div>
<div class="line">    <a class="code hl_typedef" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> rslt;</div>
<div class="line"> </div>
<div class="line">    <span class="comment">// Initialize the quadrature decoder object. Does not use index (&#39;pin&#39; is NC) and does not use a</span></div>
<div class="line">    <span class="comment">// pre-configured clock source (&#39;clk&#39; is NULL).</span></div>
<div class="line">    rslt = <a class="code hl_function" href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">cyhal_quaddec_init</a>(&amp;quaddec_obj, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a23d505c049c81443b12e53d5b00b1be9">P0_0</a>, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a8c239764fe5c947cad341b176d49eb73">P0_1</a>, <a class="code hl_enumvalue" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#gga707195ce0627016bf371643bdd9caa51a3dbd1016ea99d087d747530418b89a01">NC</a>, <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9">CYHAL_QUADDEC_RESOLUTION_4X</a>, NULL,</div>
<div class="line">                              1000000);</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">if</span> (<a class="code hl_define" href="group__group__result.html#gaf58fac450d9fff4472f03ad68f6e546e">CY_RSLT_SUCCESS</a> == rslt)</div>
<div class="line">    {</div>
<div class="line">        <span class="comment">// Assign the ISR to execute on timer interrupt</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__quaddec.html#gae34acc1d3fcf2338063bc4f46901c130">cyhal_quaddec_register_callback</a>(&amp;quaddec_obj, quaddec_event_handler, NULL);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Set the event on which timer interrupt occurs and enable it</span></div>
<div class="line">        <a class="code hl_function" href="group__group__hal__quaddec.html#ga5e4706c512360caa4048870ce587ef95">cyhal_quaddec_enable_event</a>(&amp;quaddec_obj, <a class="code hl_enumvalue" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88">CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</a>, 3, <span class="keyword">true</span>);</div>
<div class="line"> </div>
<div class="line">        <span class="comment">// Start the timer with the configured settings</span></div>
<div class="line">        rslt = <a class="code hl_function" href="group__group__hal__quaddec.html#ga8fc53534a07e2977fc2a433d92caeb8f">cyhal_quaddec_start</a>(&amp;quaddec_obj);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keywordflow">return</span> rslt;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ga5e4706c512360caa4048870ce587ef95"><div class="ttname"><a href="group__group__hal__quaddec.html#ga5e4706c512360caa4048870ce587ef95">cyhal_quaddec_enable_event</a></div><div class="ttdeci">void cyhal_quaddec_enable_event(cyhal_quaddec_t *obj, cyhal_quaddec_event_t event, uint8_t intr_priority, bool enable)</div><div class="ttdoc">Configure quadrature decoder event enable</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_gadc0da8aaf1025dd0e60c36be048950ec"><div class="ttname"><a href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a></div><div class="ttdeci">cyhal_quaddec_event_t</div><div class="ttdoc">Interrupt triggers for the quadrature decoder.</div><div class="ttdef"><b>Definition:</b> cyhal_quaddec.h:155</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_gae34acc1d3fcf2338063bc4f46901c130"><div class="ttname"><a href="group__group__hal__quaddec.html#gae34acc1d3fcf2338063bc4f46901c130">cyhal_quaddec_register_callback</a></div><div class="ttdeci">void cyhal_quaddec_register_callback(cyhal_quaddec_t *obj, cyhal_quaddec_event_callback_t callback, void *callback_arg)</div><div class="ttdoc">Register a quadrature decoder callback handler  This function does not clear the counter value.</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9"><div class="ttname"><a href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9">CYHAL_QUADDEC_RESOLUTION_4X</a></div><div class="ttdeci">@ CYHAL_QUADDEC_RESOLUTION_4X</div><div class="ttdoc">4x resolution</div><div class="ttdef"><b>Definition:</b> cyhal_quaddec.h:135</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88"><div class="ttname"><a href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88">CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</a></div><div class="ttdeci">@ CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</div><div class="ttdoc">Interrupt when terminal count is reached.</div><div class="ttdef"><b>Definition:</b> cyhal_quaddec.h:157</div></div>
<div class="ttc" id="agroup__group__hal__quaddec_html_ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64"><div class="ttname"><a href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64">CYHAL_QUADDEC_IRQ_CAPTURE</a></div><div class="ttdeci">@ CYHAL_QUADDEC_IRQ_CAPTURE</div><div class="ttdoc">Interrupt when capture value is reached.</div><div class="ttdef"><b>Definition:</b> cyhal_quaddec.h:158</div></div>
<div class="ttc" id="agroup__group__result_html_gaca79700fcc701534ce61778a9bcf57d1"><div class="ttname"><a href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a></div><div class="ttdeci">uint32_t cy_rslt_t</div><div class="ttdoc">Provides the result of an operation as a structured bitfield.</div><div class="ttdef"><b>Definition:</b> cy_result.h:438</div></div>
</div><!-- fragment --> <table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
API Reference</h2></td></tr>
<tr class="memitem:group__group__hal__results__quaddec"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__results__quaddec.html">Quadrature Decoder HAL Results</a></td></tr>
<tr class="memdesc:group__group__hal__results__quaddec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quadrature Decoder specific return codes. <br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gabf20c93be5e5b47c224fbb3d70f70a05"><td class="memItemLeft" align="right" valign="top"><a id="gabf20c93be5e5b47c224fbb3d70f70a05" name="gabf20c93be5e5b47c224fbb3d70f70a05"></a>
typedef void(*&#160;</td><td class="memItemRight" valign="bottom"><b>cyhal_quaddec_event_callback_t</b>) (void *callback_arg, <a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a> event)</td></tr>
<tr class="memdesc:gabf20c93be5e5b47c224fbb3d70f70a05"><td class="mdescLeft">&#160;</td><td class="mdescRight">Handler for quadrature decoder events. <br /></td></tr>
<tr class="separator:gabf20c93be5e5b47c224fbb3d70f70a05"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="enum-members" name="enum-members"></a>
Enumerations</h2></td></tr>
<tr class="memitem:gab7b90604bd19ab052a029de2f85355f8"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17">CYHAL_QUADDEC_RESOLUTION_1X</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a23e604c65505f63e71791a55697152b8">CYHAL_QUADDEC_RESOLUTION_2X</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9">CYHAL_QUADDEC_RESOLUTION_4X</a>
<br />
 }</td></tr>
<tr class="memdesc:gab7b90604bd19ab052a029de2f85355f8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Operating resolutions for the quadrature decoder.  <a href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">More...</a><br /></td></tr>
<tr class="separator:gab7b90604bd19ab052a029de2f85355f8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga46260f3f241adbdd8453dbd9b6b94024"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#gga46260f3f241adbdd8453dbd9b6b94024a093dbd073f88eaef20f56057ccc879cd">CYHAL_QUADDEC_INPUT_PHI_A</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#gga46260f3f241adbdd8453dbd9b6b94024a12297c334f5e721cfb277abe432b82ea">CYHAL_QUADDEC_INPUT_PHI_B</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#gga46260f3f241adbdd8453dbd9b6b94024a8613df613753ab43c306d83798e6fe11">CYHAL_QUADDEC_INPUT_STOP</a>
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#gga46260f3f241adbdd8453dbd9b6b94024a3553fa02763b19f7688bd02b9da9684a">CYHAL_QUADDEC_INPUT_INDEX</a>
<br />
 }</td></tr>
<tr class="memdesc:ga46260f3f241adbdd8453dbd9b6b94024"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quadrature decoder input signal.  <a href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">More...</a><br /></td></tr>
<tr class="separator:ga46260f3f241adbdd8453dbd9b6b94024"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e183c9d1c265bb2dac288e21fd98a87"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a> { <a class="el" href="group__group__hal__quaddec.html#gga4e183c9d1c265bb2dac288e21fd98a87a6670c43bbf7d35d845a24fd3f18dd67f">CYHAL_QUADDEC_OUTPUT_COMPARE_MATCH</a>
 }</td></tr>
<tr class="memdesc:ga4e183c9d1c265bb2dac288e21fd98a87"><td class="mdescLeft">&#160;</td><td class="mdescRight">Quadrature decoder output signal.  <a href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">More...</a><br /></td></tr>
<tr class="separator:ga4e183c9d1c265bb2dac288e21fd98a87"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gadc0da8aaf1025dd0e60c36be048950ec"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a> { <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca21c6d9813a76c6397d95d29d925a7e26">CYHAL_QUADDEC_IRQ_NONE</a> = 0
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88">CYHAL_QUADDEC_IRQ_TERMINAL_COUNT</a> = (1 &lt;&lt; 0)
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64">CYHAL_QUADDEC_IRQ_CAPTURE</a> = (1 &lt;&lt; 1)
, <br />
&#160;&#160;<a class="el" href="group__group__hal__quaddec.html#ggadc0da8aaf1025dd0e60c36be048950eca3f6b7e5f81445c05b4f46c59a285cb3e">CYHAL_QUADDEC_IRQ_ALL</a> = (1 &lt;&lt; 2) - 1
<br />
 }</td></tr>
<tr class="memdesc:gadc0da8aaf1025dd0e60c36be048950ec"><td class="mdescLeft">&#160;</td><td class="mdescRight">Interrupt triggers for the quadrature decoder.  <a href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">More...</a><br /></td></tr>
<tr class="separator:gadc0da8aaf1025dd0e60c36be048950ec"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gab9ef0a9e37021273f9f013acb8a3ca33"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">cyhal_quaddec_init</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> phi_a, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> phi_b, <a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a> index, <a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a> resolution, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *clk, uint32_t frequency)</td></tr>
<tr class="memdesc:gab9ef0a9e37021273f9f013acb8a3ca33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the quadrature decoder peripheral and configure the pin.  <a href="group__group__hal__quaddec.html#gab9ef0a9e37021273f9f013acb8a3ca33">More...</a><br /></td></tr>
<tr class="separator:gab9ef0a9e37021273f9f013acb8a3ca33"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga322e68fe98395c563a67a25d390ee730"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga322e68fe98395c563a67a25d390ee730">cyhal_quaddec_init_cfg</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__configurator__t">cyhal_quaddec_configurator_t</a> *cfg)</td></tr>
<tr class="memdesc:ga322e68fe98395c563a67a25d390ee730"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the quadrature decoder peripheral using a configurator generated configuration struct.  <a href="group__group__hal__quaddec.html#ga322e68fe98395c563a67a25d390ee730">More...</a><br /></td></tr>
<tr class="separator:ga322e68fe98395c563a67a25d390ee730"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga26c25f3f1d39e4fec61406716b350d38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga26c25f3f1d39e4fec61406716b350d38">cyhal_quaddec_free</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:ga26c25f3f1d39e4fec61406716b350d38"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deinitialize the quadrature decoder object.  <a href="group__group__hal__quaddec.html#ga26c25f3f1d39e4fec61406716b350d38">More...</a><br /></td></tr>
<tr class="separator:ga26c25f3f1d39e4fec61406716b350d38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga8fc53534a07e2977fc2a433d92caeb8f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga8fc53534a07e2977fc2a433d92caeb8f">cyhal_quaddec_start</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:ga8fc53534a07e2977fc2a433d92caeb8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Starts the quadrature decoder.  <a href="group__group__hal__quaddec.html#ga8fc53534a07e2977fc2a433d92caeb8f">More...</a><br /></td></tr>
<tr class="separator:ga8fc53534a07e2977fc2a433d92caeb8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9a3bc3f085276aeb12bc06dd4e2d445d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga9a3bc3f085276aeb12bc06dd4e2d445d">cyhal_quaddec_stop</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:ga9a3bc3f085276aeb12bc06dd4e2d445d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stops the quadrature decoder.  <a href="group__group__hal__quaddec.html#ga9a3bc3f085276aeb12bc06dd4e2d445d">More...</a><br /></td></tr>
<tr class="separator:ga9a3bc3f085276aeb12bc06dd4e2d445d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga07fb25d61894db9ca0e9b00f1876f79a"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga07fb25d61894db9ca0e9b00f1876f79a">cyhal_quaddec_get_delta</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:ga07fb25d61894db9ca0e9b00f1876f79a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Gets the change in the quadrature decoder counter, either positive or negative, since the last time that this function was called.  <a href="group__group__hal__quaddec.html#ga07fb25d61894db9ca0e9b00f1876f79a">More...</a><br /></td></tr>
<tr class="separator:ga07fb25d61894db9ca0e9b00f1876f79a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga7b3adb4bcbbdf79d5cae28fdc3c028a3"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga7b3adb4bcbbdf79d5cae28fdc3c028a3">cyhal_quaddec_read_counter</a> (const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:ga7b3adb4bcbbdf79d5cae28fdc3c028a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the current value from the quadrature decoder <br  />
 The read operation works even if the counter is stopped.  <a href="group__group__hal__quaddec.html#ga7b3adb4bcbbdf79d5cae28fdc3c028a3">More...</a><br /></td></tr>
<tr class="separator:ga7b3adb4bcbbdf79d5cae28fdc3c028a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacf324402df53900aca35e45f7f51e9a2"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gacf324402df53900aca35e45f7f51e9a2">cyhal_quaddec_read_capture</a> (const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj)</td></tr>
<tr class="memdesc:gacf324402df53900aca35e45f7f51e9a2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reads the value from the quadrature decoder's capture register <br  />
 This function does not clear the counter value.  <a href="group__group__hal__quaddec.html#gacf324402df53900aca35e45f7f51e9a2">More...</a><br /></td></tr>
<tr class="separator:gacf324402df53900aca35e45f7f51e9a2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae34acc1d3fcf2338063bc4f46901c130"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gae34acc1d3fcf2338063bc4f46901c130">cyhal_quaddec_register_callback</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__quaddec.html#gabf20c93be5e5b47c224fbb3d70f70a05">cyhal_quaddec_event_callback_t</a> callback, void *callback_arg)</td></tr>
<tr class="memdesc:gae34acc1d3fcf2338063bc4f46901c130"><td class="mdescLeft">&#160;</td><td class="mdescRight">Register a quadrature decoder callback handler<br  />
 This function does not clear the counter value.  <a href="group__group__hal__quaddec.html#gae34acc1d3fcf2338063bc4f46901c130">More...</a><br /></td></tr>
<tr class="separator:gae34acc1d3fcf2338063bc4f46901c130"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5e4706c512360caa4048870ce587ef95"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga5e4706c512360caa4048870ce587ef95">cyhal_quaddec_enable_event</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a> event, uint8_t intr_priority, bool enable)</td></tr>
<tr class="memdesc:ga5e4706c512360caa4048870ce587ef95"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure quadrature decoder event enable <br  />
  <a href="group__group__hal__quaddec.html#ga5e4706c512360caa4048870ce587ef95">More...</a><br /></td></tr>
<tr class="separator:ga5e4706c512360caa4048870ce587ef95"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gac24ad342a56665e529edf17490f588c3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gac24ad342a56665e529edf17490f588c3">cyhal_quaddec_connect_digital</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a> signal)</td></tr>
<tr class="memdesc:gac24ad342a56665e529edf17490f588c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects a source signal and configures and enables a quadrature decoder event to be triggered from that signal.  <a href="group__group__hal__quaddec.html#gac24ad342a56665e529edf17490f588c3">More...</a><br /></td></tr>
<tr class="separator:gac24ad342a56665e529edf17490f588c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga696c0f48cf99030af08b2d4ba7eac540"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga696c0f48cf99030af08b2d4ba7eac540">cyhal_quaddec_connect_digital2</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a> signal, <a class="el" href="group__group__hal__general__types.html#ga48a2f3a7a4210f50859fc68fa3db9391">cyhal_edge_type_t</a> edge_type)</td></tr>
<tr class="memdesc:ga696c0f48cf99030af08b2d4ba7eac540"><td class="mdescLeft">&#160;</td><td class="mdescRight">Connects a source signal and configures and enables a quadrature decoder event to be triggered from that signal with a configurable edge type.  <a href="group__group__hal__quaddec.html#ga696c0f48cf99030af08b2d4ba7eac540">More...</a><br /></td></tr>
<tr class="separator:ga696c0f48cf99030af08b2d4ba7eac540"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gab34102bdeb9112caf1eee5427505aad5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gab34102bdeb9112caf1eee5427505aad5">cyhal_quaddec_disconnect_digital</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> source, <a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a> signal)</td></tr>
<tr class="memdesc:gab34102bdeb9112caf1eee5427505aad5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disconnects a source signal and disables the quadrature decoder event.  <a href="group__group__hal__quaddec.html#gab34102bdeb9112caf1eee5427505aad5">More...</a><br /></td></tr>
<tr class="separator:gab34102bdeb9112caf1eee5427505aad5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8292289d8ee582f09b95a078ce89416"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#gaf8292289d8ee582f09b95a078ce89416">cyhal_quaddec_enable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a> signal, <a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *source)</td></tr>
<tr class="memdesc:gaf8292289d8ee582f09b95a078ce89416"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enables the specified output signal from a quadrature decoder that will be triggered when the corresponding event occurs.  <a href="group__group__hal__quaddec.html#gaf8292289d8ee582f09b95a078ce89416">More...</a><br /></td></tr>
<tr class="separator:gaf8292289d8ee582f09b95a078ce89416"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga453498f398dfbbdf2ec7d225262777d3"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__hal__quaddec.html#ga453498f398dfbbdf2ec7d225262777d3">cyhal_quaddec_disable_output</a> (<a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *obj, <a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a> signal)</td></tr>
<tr class="memdesc:ga453498f398dfbbdf2ec7d225262777d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disables the specified output signal from a quadrature decoder.  <a href="group__group__hal__quaddec.html#ga453498f398dfbbdf2ec7d225262777d3">More...</a><br /></td></tr>
<tr class="separator:ga453498f398dfbbdf2ec7d225262777d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Enumeration Type Documentation</h2>
<a id="gab7b90604bd19ab052a029de2f85355f8" name="gab7b90604bd19ab052a029de2f85355f8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab7b90604bd19ab052a029de2f85355f8">&#9670;&nbsp;</a></span>cyhal_quaddec_resolution_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Operating resolutions for the quadrature decoder. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17" name="ggab7b90604bd19ab052a029de2f85355f8a4bcfcf54ae835dd2d021f4feb21b9b17"></a>CYHAL_QUADDEC_RESOLUTION_1X&#160;</td><td class="fielddoc"><p >1x resolution </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab7b90604bd19ab052a029de2f85355f8a23e604c65505f63e71791a55697152b8" name="ggab7b90604bd19ab052a029de2f85355f8a23e604c65505f63e71791a55697152b8"></a>CYHAL_QUADDEC_RESOLUTION_2X&#160;</td><td class="fielddoc"><p >2x resolution </p>
</td></tr>
<tr><td class="fieldname"><a id="ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9" name="ggab7b90604bd19ab052a029de2f85355f8a3f74e6d45ac7098b3964415801e3c3c9"></a>CYHAL_QUADDEC_RESOLUTION_4X&#160;</td><td class="fielddoc"><p >4x resolution </p>
</td></tr>
</table>

</div>
</div>
<a id="ga46260f3f241adbdd8453dbd9b6b94024" name="ga46260f3f241adbdd8453dbd9b6b94024"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga46260f3f241adbdd8453dbd9b6b94024">&#9670;&nbsp;</a></span>cyhal_quaddec_input_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quadrature decoder input signal. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga46260f3f241adbdd8453dbd9b6b94024a093dbd073f88eaef20f56057ccc879cd" name="gga46260f3f241adbdd8453dbd9b6b94024a093dbd073f88eaef20f56057ccc879cd"></a>CYHAL_QUADDEC_INPUT_PHI_A&#160;</td><td class="fielddoc"><p >The "A" input of the quadrature decoder. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga46260f3f241adbdd8453dbd9b6b94024a12297c334f5e721cfb277abe432b82ea" name="gga46260f3f241adbdd8453dbd9b6b94024a12297c334f5e721cfb277abe432b82ea"></a>CYHAL_QUADDEC_INPUT_PHI_B&#160;</td><td class="fielddoc"><p >The "B" input of the quadrature decoder. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga46260f3f241adbdd8453dbd9b6b94024a8613df613753ab43c306d83798e6fe11" name="gga46260f3f241adbdd8453dbd9b6b94024a8613df613753ab43c306d83798e6fe11"></a>CYHAL_QUADDEC_INPUT_STOP&#160;</td><td class="fielddoc"><p >Stops the counter from counting when activated. </p>
</td></tr>
<tr><td class="fieldname"><a id="gga46260f3f241adbdd8453dbd9b6b94024a3553fa02763b19f7688bd02b9da9684a" name="gga46260f3f241adbdd8453dbd9b6b94024a3553fa02763b19f7688bd02b9da9684a"></a>CYHAL_QUADDEC_INPUT_INDEX&#160;</td><td class="fielddoc"><p >A reference signal that resets the counter when activated. </p>
</td></tr>
</table>

</div>
</div>
<a id="ga4e183c9d1c265bb2dac288e21fd98a87" name="ga4e183c9d1c265bb2dac288e21fd98a87"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4e183c9d1c265bb2dac288e21fd98a87">&#9670;&nbsp;</a></span>cyhal_quaddec_output_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Quadrature decoder output signal. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="gga4e183c9d1c265bb2dac288e21fd98a87a6670c43bbf7d35d845a24fd3f18dd67f" name="gga4e183c9d1c265bb2dac288e21fd98a87a6670c43bbf7d35d845a24fd3f18dd67f"></a>CYHAL_QUADDEC_OUTPUT_COMPARE_MATCH&#160;</td><td class="fielddoc"><p >Compare Match signal. </p>
</td></tr>
</table>

</div>
</div>
<a id="gadc0da8aaf1025dd0e60c36be048950ec" name="gadc0da8aaf1025dd0e60c36be048950ec"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gadc0da8aaf1025dd0e60c36be048950ec">&#9670;&nbsp;</a></span>cyhal_quaddec_event_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Interrupt triggers for the quadrature decoder. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ggadc0da8aaf1025dd0e60c36be048950eca21c6d9813a76c6397d95d29d925a7e26" name="ggadc0da8aaf1025dd0e60c36be048950eca21c6d9813a76c6397d95d29d925a7e26"></a>CYHAL_QUADDEC_IRQ_NONE&#160;</td><td class="fielddoc"><p >No interrupt handled. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88" name="ggadc0da8aaf1025dd0e60c36be048950eca2f34ea17712071a2494ff3d129490f88"></a>CYHAL_QUADDEC_IRQ_TERMINAL_COUNT&#160;</td><td class="fielddoc"><p >Interrupt when terminal count is reached. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64" name="ggadc0da8aaf1025dd0e60c36be048950eca58a9457288d89e396df8829ee4078b64"></a>CYHAL_QUADDEC_IRQ_CAPTURE&#160;</td><td class="fielddoc"><p >Interrupt when capture value is reached. </p>
</td></tr>
<tr><td class="fieldname"><a id="ggadc0da8aaf1025dd0e60c36be048950eca3f6b7e5f81445c05b4f46c59a285cb3e" name="ggadc0da8aaf1025dd0e60c36be048950eca3f6b7e5f81445c05b4f46c59a285cb3e"></a>CYHAL_QUADDEC_IRQ_ALL&#160;</td><td class="fielddoc"><p >Interrupt on any event. </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="gab9ef0a9e37021273f9f013acb8a3ca33" name="gab9ef0a9e37021273f9f013acb8a3ca33"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab9ef0a9e37021273f9f013acb8a3ca33">&#9670;&nbsp;</a></span>cyhal_quaddec_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>phi_a</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>phi_b</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__pin__package__psoc6__01__104__m__csp__ble.html#ga707195ce0627016bf371643bdd9caa51">cyhal_gpio_t</a>&#160;</td>
          <td class="paramname"><em>index</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#gab7b90604bd19ab052a029de2f85355f8">cyhal_quaddec_resolution_t</a>&#160;</td>
          <td class="paramname"><em>resolution</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__clock__t">cyhal_clock_t</a> *&#160;</td>
          <td class="paramname"><em>clk</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>frequency</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the quadrature decoder peripheral and configure the pin. </p>
<p ><br  />
 See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_1">Snippet 1: Initialization and direction detection</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a quadrature decoder object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">phi_a</td><td>- The "A" input of the quadrature decoder. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">phi_b</td><td>- The "B" input of the quadrature decoder. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>- Optional, resets the counter when active to act as a reference position for the quadrature decoder. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">resolution</td><td>- The resolution that the quadrature decoder runs at </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">clk</td><td>- Optional, the shared clock to use, if not provided a new clock will be allocated and the quadrature decoder frequency will be set to the value passed in with the frequency parameter. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">frequency</td><td>- This is the frequency, in hertz, to use with the clock allocated by this function. This parameter is only used if the clk parameter is set to NULL. When the clk parameter is not NULL, this must be set to zero. When the clk paramether is NULL, this must be set to something other than zero. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga322e68fe98395c563a67a25d390ee730" name="ga322e68fe98395c563a67a25d390ee730"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga322e68fe98395c563a67a25d390ee730">&#9670;&nbsp;</a></span>cyhal_quaddec_init_cfg()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_init_cfg </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__configurator__t">cyhal_quaddec_configurator_t</a> *&#160;</td>
          <td class="paramname"><em>cfg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Initialize the quadrature decoder peripheral using a configurator generated configuration struct. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[out]</td><td class="paramname">obj</td><td>Pointer to a quadrature decoder object. The caller must allocate the memory for this object but the init function will initialize its contents. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">cfg</td><td>Configuration structure generated by a configurator. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the init request </dd></dl>

</div>
</div>
<a id="ga26c25f3f1d39e4fec61406716b350d38" name="ga26c25f3f1d39e4fec61406716b350d38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga26c25f3f1d39e4fec61406716b350d38">&#9670;&nbsp;</a></span>cyhal_quaddec_free()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_quaddec_free </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Deinitialize the quadrature decoder object. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in,out]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga8fc53534a07e2977fc2a433d92caeb8f" name="ga8fc53534a07e2977fc2a433d92caeb8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga8fc53534a07e2977fc2a433d92caeb8f">&#9670;&nbsp;</a></span>cyhal_quaddec_start()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_start </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Starts the quadrature decoder. </p>
<p >This function also acts as a reset, in that it will trigger reload/index the QuadDec. When this function is called, the count value gets stored in the capture register and the count value is returned to the mid point. For example, if the hardware has 16-bit resolution, the midpoint would be 0x8000. For 32-bit resolution: 0x80000000. See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_1">Snippet 1: Initialization and direction detection</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the start request </dd></dl>

</div>
</div>
<a id="ga9a3bc3f085276aeb12bc06dd4e2d445d" name="ga9a3bc3f085276aeb12bc06dd4e2d445d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9a3bc3f085276aeb12bc06dd4e2d445d">&#9670;&nbsp;</a></span>cyhal_quaddec_stop()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_stop </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Stops the quadrature decoder. </p>
<p >Does not reset counter value. <br  />
</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the stop request </dd></dl>

</div>
</div>
<a id="ga07fb25d61894db9ca0e9b00f1876f79a" name="ga07fb25d61894db9ca0e9b00f1876f79a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga07fb25d61894db9ca0e9b00f1876f79a">&#9670;&nbsp;</a></span>cyhal_quaddec_get_delta()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int32_t cyhal_quaddec_get_delta </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Gets the change in the quadrature decoder counter, either positive or negative, since the last time that this function was called. </p>
<dl class="section note"><dt>Note</dt><dd>This function is not intended for applications requiring high speed or high accuracy such as getting motor positions. It is intended for applications involving devices like radial dials.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The amount that the counter has changed </dd></dl>

</div>
</div>
<a id="ga7b3adb4bcbbdf79d5cae28fdc3c028a3" name="ga7b3adb4bcbbdf79d5cae28fdc3c028a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga7b3adb4bcbbdf79d5cae28fdc3c028a3">&#9670;&nbsp;</a></span>cyhal_quaddec_read_counter()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_quaddec_read_counter </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the current value from the quadrature decoder <br  />
 The read operation works even if the counter is stopped. </p>
<p >See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_1">Snippet 1: Initialization and direction detection</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current value of the quadrature decoder counter register </dd></dl>

</div>
</div>
<a id="gacf324402df53900aca35e45f7f51e9a2" name="gacf324402df53900aca35e45f7f51e9a2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacf324402df53900aca35e45f7f51e9a2">&#9670;&nbsp;</a></span>cyhal_quaddec_read_capture()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t cyhal_quaddec_read_capture </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reads the value from the quadrature decoder's capture register <br  />
 This function does not clear the counter value. </p>
<p >The capture register is updated whenever there is an index event.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The current value of the quadrature decoder capture register </dd></dl>

</div>
</div>
<a id="gae34acc1d3fcf2338063bc4f46901c130" name="gae34acc1d3fcf2338063bc4f46901c130"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gae34acc1d3fcf2338063bc4f46901c130">&#9670;&nbsp;</a></span>cyhal_quaddec_register_callback()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_quaddec_register_callback </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#gabf20c93be5e5b47c224fbb3d70f70a05">cyhal_quaddec_event_callback_t</a>&#160;</td>
          <td class="paramname"><em>callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>callback_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Register a quadrature decoder callback handler<br  />
 This function does not clear the counter value. </p>
<p >This function will be called when one of the events enabled by <a class="el" href="group__group__hal__quaddec.html#ga5e4706c512360caa4048870ce587ef95">cyhal_quaddec_enable_event</a> occurs.</p>
<p >See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_2">Snippet 2: Handling an event in a callback function</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>The callback handler which will be invoked when the event occurs </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">callback_arg</td><td>Generic argument that will be provided to the callback when called </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="ga5e4706c512360caa4048870ce587ef95" name="ga5e4706c512360caa4048870ce587ef95"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5e4706c512360caa4048870ce587ef95">&#9670;&nbsp;</a></span>cyhal_quaddec_enable_event()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void cyhal_quaddec_enable_event </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#gadc0da8aaf1025dd0e60c36be048950ec">cyhal_quaddec_event_t</a>&#160;</td>
          <td class="paramname"><em>event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t&#160;</td>
          <td class="paramname"><em>intr_priority</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enable</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure quadrature decoder event enable <br  />
 </p>
<p >When an enabled event occurs, the function specified by <a class="el" href="group__group__hal__quaddec.html#gae34acc1d3fcf2338063bc4f46901c130">cyhal_quaddec_register_callback</a> will be called.</p>
<p >See <a class="el" href="group__group__hal__quaddec.html#subsection_quaddec_snippet_2">Snippet 2: Handling an event in a callback function</a>.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>The quadrature decoder object </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">event</td><td>The quadrature decoder event type </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">intr_priority</td><td>The priority for NVIC interrupt events </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">enable</td><td>True to turn on interrupts, False to turn off </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="gac24ad342a56665e529edf17490f588c3" name="gac24ad342a56665e529edf17490f588c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac24ad342a56665e529edf17490f588c3">&#9670;&nbsp;</a></span>cyhal_quaddec_connect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_connect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects a source signal and configures and enables a quadrature decoder event to be triggered from that signal. </p>
<p >These quadrature decoder events can be configured independently and connect to the same or different source signals. </p><dl class="section note"><dt>Note</dt><dd>For "edge" signals, this function will default to rising edge. To control the edge type, use <a class="el" href="group__group__hal__quaddec.html#ga696c0f48cf99030af08b2d4ba7eac540">cyhal_quaddec_connect_digital2</a></dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Quadrature decoder obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal obtained from another driver's cyhal_&lt;PERIPH&gt;_enable_output </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The quadrature decoder input signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the connection </dd></dl>

</div>
</div>
<a id="ga696c0f48cf99030af08b2d4ba7eac540" name="ga696c0f48cf99030af08b2d4ba7eac540"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga696c0f48cf99030af08b2d4ba7eac540">&#9670;&nbsp;</a></span>cyhal_quaddec_connect_digital2()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_connect_digital2 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__general__types.html#ga48a2f3a7a4210f50859fc68fa3db9391">cyhal_edge_type_t</a>&#160;</td>
          <td class="paramname"><em>edge_type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Connects a source signal and configures and enables a quadrature decoder event to be triggered from that signal with a configurable edge type. </p>
<p >These quadrature decoder events can be configured independently and connect to the same or different source signals.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Quadrature decoder obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal obtained from another driver's cyhal_&lt;PERIPH&gt;_enable_output </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The quadrature decoder input signal </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">edge_type</td><td>The edge type that should trigger the event. This must be consistent with the edge type of <code>source</code>. If <code>source</code> produces a "level" signal, the only valid value is <a class="el" href="group__group__hal__general__types.html#gga48a2f3a7a4210f50859fc68fa3db9391aa3d90da24e0ba6dff6a0f4c816d1853b">CYHAL_EDGE_TYPE_LEVEL</a>. If <code>source</code> produces an "edge" signal, then <a class="el" href="group__group__hal__general__types.html#gga48a2f3a7a4210f50859fc68fa3db9391aa3d90da24e0ba6dff6a0f4c816d1853b">CYHAL_EDGE_TYPE_LEVEL</a> is not a valid value. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the connection </dd></dl>

</div>
</div>
<a id="gab34102bdeb9112caf1eee5427505aad5" name="gab34102bdeb9112caf1eee5427505aad5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gab34102bdeb9112caf1eee5427505aad5">&#9670;&nbsp;</a></span>cyhal_quaddec_disconnect_digital()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_disconnect_digital </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a>&#160;</td>
          <td class="paramname"><em>source</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#ga46260f3f241adbdd8453dbd9b6b94024">cyhal_quaddec_input_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disconnects a source signal and disables the quadrature decoder event. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Quadrature decoder obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">source</td><td>Source signal from cyhal_&lt;PERIPH&gt;_enable_output to disable </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The quadrature decoder input signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the disconnection </dd></dl>

</div>
</div>
<a id="gaf8292289d8ee582f09b95a078ce89416" name="gaf8292289d8ee582f09b95a078ce89416"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf8292289d8ee582f09b95a078ce89416">&#9670;&nbsp;</a></span>cyhal_quaddec_enable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_enable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__triggers__psoc6__01.html#ga96236d1368f920d28af90262e8b57046">cyhal_source_t</a> *&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enables the specified output signal from a quadrature decoder that will be triggered when the corresponding event occurs. </p>
<p >Multiple output signals can be configured simultaneously.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Quadrature decoder obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The quadrature decoder output signal </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">source</td><td>Pointer to user-allocated source signal object which will be initialized by enable_output. <code>source</code> should be passed to (dis)connect_digital functions to (dis)connect the associated endpoints. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output enable </dd></dl>

</div>
</div>
<a id="ga453498f398dfbbdf2ec7d225262777d3" name="ga453498f398dfbbdf2ec7d225262777d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga453498f398dfbbdf2ec7d225262777d3">&#9670;&nbsp;</a></span>cyhal_quaddec_disable_output()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__group__result.html#gaca79700fcc701534ce61778a9bcf57d1">cy_rslt_t</a> cyhal_quaddec_disable_output </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__group__hal__impl__hw__types.html#structcyhal__quaddec__t">cyhal_quaddec_t</a> *&#160;</td>
          <td class="paramname"><em>obj</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__hal__quaddec.html#ga4e183c9d1c265bb2dac288e21fd98a87">cyhal_quaddec_output_t</a>&#160;</td>
          <td class="paramname"><em>signal</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disables the specified output signal from a quadrature decoder. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">obj</td><td>Quadrature decoder obj </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">signal</td><td>The quadrature decoder output signal </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The status of the output disable </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Hardware Abstraction Layer (HAL)</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
